using System;
using System.Collections.Generic;
using System.Text;

namespace MacomberMap.Common.Events
{
    /// <summary>
    /// This class holds information on a permission loading error
    /// </summary>
    public class MM_Event_PermissionLoadingError: MM_Event
    {
        /// <summary>
        /// The name of the permission
        /// </summary>
        public String PermissionName;

        /// <summary>
        /// The value of the permission
        /// </summary>
        public String PermissionValue;

        /// <summary>
        /// The error message that occurred
        /// </summary>
        public string ErrorMessage;

        /// <summary>
        /// Initialize a new permissions loading error
        /// </summary>
        /// <param name="PermissionName">The name of the permission</param>
        /// <param name="PermissionValue">The value of the permission</param>
        /// <param name="ErrorMessage">The error message</param>
        public MM_Event_PermissionLoadingError(String PermissionName, String PermissionValue, string ErrorMessage)
        {
            this.PermissionName = PermissionName;
            this.PermissionValue = PermissionValue;
            this.ErrorMessage = ErrorMessage;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="OutMenu"></param>
        public override void AddMenuItems(System.Windows.Forms.ContextMenuStrip OutMenu)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override System.Windows.Forms.ListViewItem BuildListViewItem()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="OutParent"></param>
        public override void DisplayDetails(System.Windows.Forms.Control OutParent)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="lvItem"></param>
        public override void UpdateListViewItem(System.Windows.Forms.ListViewItem lvItem)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        /// <summary>
        /// Compare two permissions errors
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override int CompareTo(object obj)
        {
            int CompareResult = PermissionName.CompareTo((obj as MM_Event_PermissionLoadingError).PermissionName);
            if (CompareResult != 0)
                return CompareResult;
            else
                return ErrorMessage.CompareTo((obj as MM_Event_PermissionLoadingError).ErrorMessage);
        }
    }
}
